const mongoose = require('mongoose')
const bcrypt = require('bcryptjs')

const adminSchema = new mongoose.Schema({
    username:{
        type:String,
        required:true,
        unique:true
    },
    password:{
        type:String,
        set(val){
            return bcrypt.hashSync(val,10)
        }
    }
})

module.exports = mongoose.model('Admin',adminSchema,'admin')